import React from 'react'
import { useState } from 'react'
import Gege from './components/Gege'
import Didi from './components/Didi'

//创建一个可以提供数据的上下文对象 然后暴露出去
export const AppContext = React.createContext()

export default function App() {
  const [money, setMoney] = useState(1)
  const [car, setCar] = useState('五菱宏光')
  const changeMoney = () => {
    setMoney(money+1)
  }
  return (
    <div>
      <p>我是你爹</p>
      <p>我有{money}$</p>
      <button onClick={changeMoney}>赚钱了</button>
      <hr/>
      <Gege car={car} setCar={setCar}/>
      <hr />
      <Didi car={car}/>
    </div>
  )
}




